home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / zstrcom / form21.frm next >
Text File  |  1998-06-22  |  5KB  |  177 lines

  1. VERSION 5.00
  2. Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.1#0"; "RICHTX32.OCX"
  3. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.1#0"; "COMDLG32.OCX"
  4. Object = "{F79ED619-0A0D-11D2-9F03-F39552419543}#6.0#0"; "zlib15.ocx"
  5. Begin VB.Form Form1 
  6.    BorderStyle     =   1  'Fixed Single
  7.    Caption         =   "Zlib StringCompress 1.5 Sample Project"
  8.    ClientHeight    =   5700
  9.    ClientLeft      =   45
  10.    ClientTop       =   615
  11.    ClientWidth     =   6030
  12.    Icon            =   "Form21.frx":0000
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    ScaleHeight     =   5700
  16.    ScaleWidth      =   6030
  17.    StartUpPosition =   2  'CenterScreen
  18.    Begin MaqZlib20.Zlib Zlib1 
  19.       Left            =   1920
  20.       Top             =   1800
  21.       _ExtentX        =   1032
  22.       _ExtentY        =   1032
  23.    End
  24.    Begin MSComDlg.CommonDialog CommonDialog1 
  25.       Left            =   1680
  26.       Top             =   1800
  27.       _ExtentX        =   847
  28.       _ExtentY        =   847
  29.       _Version        =   327681
  30.    End
  31.    Begin VB.CommandButton Command4 
  32.       Caption         =   "Uncompress file"
  33.       Height          =   495
  34.       Left            =   3480
  35.       TabIndex        =   6
  36.       Top             =   5040
  37.       Width           =   1815
  38.    End
  39.    Begin VB.CommandButton Command3 
  40.       Caption         =   "Compress file"
  41.       Height          =   495
  42.       Left            =   840
  43.       TabIndex        =   5
  44.       Top             =   5040
  45.       Width           =   1815
  46.    End
  47.    Begin VB.CommandButton Command2 
  48.       Caption         =   "Uncompress string"
  49.       Height          =   495
  50.       Left            =   3480
  51.       TabIndex        =   4
  52.       Top             =   4440
  53.       Width           =   1815
  54.    End
  55.    Begin VB.CommandButton Command1 
  56.       Caption         =   "Compress string"
  57.       Height          =   495
  58.       Left            =   840
  59.       TabIndex        =   3
  60.       Top             =   4440
  61.       Width           =   1815
  62.    End
  63.    Begin RichTextLib.RichTextBox RichTextBox3 
  64.       Height          =   1335
  65.       Left            =   120
  66.       TabIndex        =   2
  67.       ToolTipText     =   "Here will apear the reconstructed text"
  68.       Top             =   3000
  69.       Width           =   5775
  70.       _ExtentX        =   10186
  71.       _ExtentY        =   2355
  72.       _Version        =   327681
  73.       Enabled         =   -1  'True
  74.       ScrollBars      =   2
  75.       TextRTF         =   $"Form21.frx":0ABA
  76.    End
  77.    Begin RichTextLib.RichTextBox RichTextBox2 
  78.       Height          =   1335
  79.       Left            =   120
  80.       TabIndex        =   1
  81.       ToolTipText     =   "Here the compressed output will apear"
  82.       Top             =   1560
  83.       Width           =   5775
  84.       _ExtentX        =   10186
  85.       _ExtentY        =   2355
  86.       _Version        =   327681
  87.       Enabled         =   -1  'True
  88.       ScrollBars      =   2
  89.       TextRTF         =   $"Form21.frx":0B83
  90.    End
  91.    Begin RichTextLib.RichTextBox RichTextBox1 
  92.       Height          =   1335
  93.       Left            =   120
  94.       TabIndex        =   0
  95.       ToolTipText     =   "Type here the text to be compressed"
  96.       Top             =   120
  97.       Width           =   5775
  98.       _ExtentX        =   10186
  99.       _ExtentY        =   2355
  100.       _Version        =   327681
  101.       Enabled         =   -1  'True
  102.       ScrollBars      =   2
  103.       TextRTF         =   $"Form21.frx":0C4C
  104.    End
  105.    Begin VB.Menu about 
  106.       Caption         =   "About"
  107.    End
  108. End
  109. Attribute VB_Name = "Form1"
  110. Attribute VB_GlobalNameSpace = False
  111. Attribute VB_Creatable = False
  112. Attribute VB_PredeclaredId = True
  113. Attribute VB_Exposed = False
  114.  
  115. Private Sub about_Click()
  116. Zlib1.AboutBox
  117. End Sub
  118.  
  119. Private Sub Command1_Click()
  120. Dim Myinput As String
  121. Dim Myoutput As String
  122. Dim Myreturn As Boolean
  123. Myinput = RichTextBox1.Text
  124. Myreturn = Zlib1.ZlibCompress(Myinput, Myoutput)
  125. RichTextBox2.Text = Myoutput
  126. End Sub
  127.  
  128. Private Sub Command2_Click()
  129. Dim Myinput As String
  130. Dim Myoutput As String
  131. Dim Myreturn As Boolean
  132. Myinput = RichTextBox2.Text
  133. Myreturn = Zlib1.ZlibUncompress(Myinput, Myoutput)
  134. RichTextBox3.Text = Myoutput
  135. End Sub
  136.  
  137.  
  138.  
  139. Private Sub Command3_Click()
  140. CommonDialog1.Filter = "All Files (*.*)|*.*"
  141. CommonDialog1.FilterIndex = 1
  142. CommonDialog1.ShowOpen
  143. If CommonDialog1.filename = "" Then Exit Sub
  144. Dim Myinput As String
  145. Dim Myoutput As String
  146. Dim Myreturn As Boolean
  147. Myinput = CommonDialog1.filename
  148. CommonDialog1.filename = CommonDialog1.filename & ".gz"
  149. CommonDialog1.Filter = "All Files (*.*)|*.*"
  150. CommonDialog1.FilterIndex = 1
  151. CommonDialog1.ShowSave
  152. If CommonDialog1.filename = "" Then Exit Sub
  153. Myoutput = CommonDialog1.filename
  154. Myreturn = Zlib1.ZlibCompressFile(Myinput, Myoutput, "9")
  155. Beep
  156. End Sub
  157.  
  158. Private Sub Command4_Click()
  159.  
  160. CommonDialog1.Filter = "All Files (*.*)|*.*"
  161. CommonDialog1.FilterIndex = 1
  162. CommonDialog1.ShowOpen
  163. If CommonDialog1.filename = "" Then Exit Sub
  164. Dim Myinput As String
  165. Dim Myoutput As String
  166. Dim Myreturn As Boolean
  167. Myinput = CommonDialog1.filename
  168. CommonDialog1.Filter = "All Files (*.*)|*.*"
  169. CommonDialog1.FilterIndex = 1
  170. CommonDialog1.ShowSave
  171. If CommonDialog1.filename = "" Then Exit Sub
  172. Myoutput = CommonDialog1.filename
  173. Myreturn = Zlib1.ZlibUnCompressFile(Myinput, Myoutput)
  174. Beep
  175. End Sub
  176.  
  177.